import React from 'react'
import { Button, Form, Input, Select, Card } from 'antd';
import WangEditor from '@/components/WangEditor';
import OaBreadcrumb from '@/components/OaBreadcrumb';


export default function PublishInform() {
    const onFinish = (values) => {
        console.log('Success:', values);
    };
    const onFinishFailed = (errorInfo) => {
        console.log('Failed:', errorInfo);
    };

    const options = [];
    for (let i = 10; i < 36; i++) {
        options.push({
            label: i.toString(36) + i,
            value: i.toString(36) + i,
        });
    }
    const handleChange = (value) => {
        console.log(`selected ${value}`);
    };
    return (
        <div>
            <OaBreadcrumb></OaBreadcrumb>
            <Card>
                <Form
                    name="basic"
                    initialValues={{
                        remember: true,
                    }}
                    onFinish={onFinish}
                    onFinishFailed={onFinishFailed}
                    autoComplete="off"
                    labelCol={{
                        span: 2,
                    }}
                    wrapperCol={{
                        span: 22,
                    }}
                >
                    <Form.Item label="标题" name="title" rules={[{ required: true, message: '请输入标题!' }]}>
                        <Input />
                    </Form.Item>

                    <Form.Item label="部门可见" name="department" valuePropName="checked" rules={[{ required: true, message: '请选择部门!' }]}>
                        <Select
                            mode="multiple"
                            allowClear
                            style={{
                                width: '100%',
                            }}
                            placeholder="请选择"
                            onChange={handleChange}
                            options={options}
                        />
                    </Form.Item>

                    <Form.Item label="内容" name="content" rules={[{ required: true, message: '请输入内容!' }]}>
                        <WangEditor></WangEditor>
                    </Form.Item>


                    <Form.Item style={{ display: 'flex', justifyContent: 'right' }} >
                        <Button type="primary" htmlType="submit">
                            提交
                        </Button>
                    </Form.Item>
                </Form>
            </Card>

        </div>
    )
}
